﻿<%@ Page Title="" Language="C#" MasterPageFile="~/EasyUI.Master" AutoEventWireup="true" CodeBehind="DocumentSubmit.aspx.cs" Inherits="lcsign.Web.documentTransfer.DocumentSubmit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        var did = "";
        var uid = "<%=uid%>";
        $(function () {
            did = getUrlParam("id");
            Init();
        });

        function Init()
        {
            if (did != "") {
                $.ajax({
                    url: "DocOp.ashx?id=" + did + "&action=query",
                    contentType: "application/json",
                    dataType: "json",
                    data: "{}",
                    type: "POST",
                    success: function (data) {
                        if (data != null) {
                            var upfile = data[0].upfile;
                            //$('#dlg').dialog('open').dialog('setTitle', '提交审核');
                            var url = encodeURI("<%=mHttpUrl %>" + "documentinfo/FileLoad.aspx?DocumentID=" + upfile);
                            iStylePDF.HttpClient.DownLoadToFile(url);

                            if (data[0].status != 0) {
                                $("#submitDoc").hide();
                            }
                            
                        }


                    },
                    error: function (x, e) {
                        //alert(x.responseText);

                    }
                });


            }

           
        }

        function submitDoc()
        {
            if (did !="") {
                $.ajax({
                    url: "DocOp.ashx?id=" + did + "&action=submitDoc",//此处不能有空格“id = " + did”这样写会出错
                    dataType: "text",
                    data: "{}",
                    type: "POST",
                    success: function (result) {
                        if ((result.indexOf("T") == 0)) {
                            $("#warnInfo").html("提交审核成功！");
                            //$.messager.alert("提示", "恭喜您，信息添加成功", "info");
                            $("#submitDoc").hide();
                           
                        } else if (result == "F_WF01") {
                            $("#warnInfo").html("写入流程出错！");
                            //$.messager.alert("提示", "写入流程出错！", "info");
                            //return;
                           
                        } else if (result == "F_DFI01") {
                            $("#warnInfo").html("文档流程出现多条记录，提交失败！");
                            //$.messager.alert("提示", "文档流程出现多条记录，提交失败！", "info");
                            //return;
                      
                        } else if (result == "F_DI01") {
                            $("#warnInfo").html("文档出现多条记录，提交失败！");
                            //$.messager.alert("提示", "文档出现多条记录，提交失败！", "info");
                            //return;
                       
                        }
                    },
                    error: function (x, e) {
                        //alert(x.responseText);

                    }
                });
            }
        }

    </script>
    <script type="text/javascript" language="javascript" for="iStylePDF" event="OnApplicationCreate(App)">
        //控件创建完成事件
        //控件使用的语言
        var lcid = App.Options.Lcid;
        //控件是否高亮域
        //App.Options.HighlightField = false;
        //隐藏下侧的导航工具栏
        App.Options.NavBarVisible = false;
        //隐藏左侧的命令工具栏
        App.Options.TabCommandBarVisible = false;
        //是否允许键盘快捷键操作
        App.Options.EnableAccelerator = true;
        //是否允许打开的文档记录历史记录中
        App.Options.HistoryEnabled = false;
        //设置单文档模式
        App.Options.DocumentsLayout = 0;
        //是否显示起始页
        App.Options.StartPageVisible = false;
        //打开文档100%显示
        //App.Options.PageZoomMode = 1;
        //App.Options.UserName = "青岛信元物和供应链有限公司";
        App.Options.UserName = "艾思玳尔测试";


    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  

     
    <div id="dlg" class="easyui-panel"  title="审核内容"  style="width: 100%; height:100%;overflow: auto;">
       
        <div style="height: 100%;">
            <object id="iStylePDF" width="100%" height="100%" classid="CLSID:7017318C-BC50-4DAF-9E4A-10AC8364C315" codebase="iStylePDF.cab#version=3,0,6,2155"></object>
        </div>
         <div class="easyui-panel">
             <input type="hidden" name="did" id="did" />
             <a href="javascript:void(0)" onclick="submitDoc() " id="submitDoc" name="submitDoc" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">提交审核</a>   
             <span id="warnInfo"  style="color:red;font-weight:bold;" name="warnInfo"/>
        </div>
    </div>
   
</asp:Content>
